package day1102.demo03;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @author wql
 * @version 1.0
 * @date 2022/11/2 15:23
 */

public class WqlExecutorMothod {
    public static void main(String[] args) {
        ExecutorService executorService = Executors.newFixedThreadPool(5);
        for (int i = 0; i <10 ; i++) {
            executorService.submit(new Runnable() {
                @Override
                public void run() {
                    System.out.println(Thread.currentThread().getName()+"====");
                }
            });
        }
        //终止等待的任务，不终止已经进行的任务
       // executorService.shutdownNow();

        //提交的全部任务进行完再停止
        executorService.shutdown();
    }

}
